<template>
  <div class="header-banner">
    <div class="w1300">
      <img src="@/assets/images/vip/banner.png" />
      <h2>佰菌云会员</h2>
      <p>
        会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍会员介绍
      </p>
    </div>
  </div>
  <div class="container">
    <div class="content w1300">
      <ul>
        <li v-for="(item, i) in vipData" :key="i">
          <div
            class="top-wrap"
            :style="{ color: item.color, background: `url(${imgUrl(i + 1)})` }"
          >
            <h3>经典会员</h3>
            <p>{{ i === 5 ? '' : '升级写作效率升级写作效率' }}</p>

            <p class="price">
              ￥
              <b>30</b>
              /月
            </p>
            <s>{{ i === 5 ? '' : '原价 ¥30/月' }}</s>

            <div class="vip-large" v-if="i === 5">
              <p>当地部署服务器集群</p>
              <p>独享本地计算资源</p>
              <p>云指令计算</p>
              <p>不限账户数</p>
            </div>

            <button :style="{ 'background-color': item.btnColor }" class="btn">
              立即开通
            </button>
          </div>
          <ul class="bottom-wrap" v-if="i !== 5">
            <li>
              <span>¥35/季</span>
              <el-button type="info">立即开通</el-button>
            </li>
            <li>
              <span>¥35/季</span>
              <el-button type="info">立即开通</el-button>
            </li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const imgUrl = (url: string) => {
  return new URL(`/src/assets/images/vip/${url}.png`, import.meta.url).href
}

const vipData = ref([
  { color: '#333534', btnColor: '#E8EAEE' },
  { color: '#271E04', btnColor: '#DFB977' },
  { color: '#DEC98E', btnColor: '#66686F' },
  { color: '#ffffff', btnColor: '#9AA3B2' },
  { color: '#ffffff', btnColor: '#9AA3B2' },
  { color: '#DEC98E', btnColor: '#66686F' },
])
</script>

<style scoped lang="scss">
.header-banner {
  position: relative;

  .w1300 {
    color: #fff;
    padding: 78px 0;

    > img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
    }

    h2 {
      font-size: 40px;
      font-weight: bold;
    }

    p {
      font-size: 18px;
      margin-top: 30px;
      width: 860px;
      line-height: 27px;
      z-index: 2;
    }
  }
}

.container {
  background-color: #f7f8fa;
  padding-bottom: 50px;
}

.content {
  padding-top: 113px;

  > ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    > li {
      width: 296px;
      margin-right: 42px;
      margin-bottom: 36px;
      background-color: #fff;
      border-radius: 5px;
      overflow: hidden;

      &:nth-child(3n) {
        margin-right: 0;
      }

      .top-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 24px 30px;
        color: #333534;
        background-size: cover;

        h3 {
          font-size: 24px;
          margin-bottom: 10px;
        }

        p {
          font-size: 12px;
          margin-bottom: 10px;

          &.price {
            font-size: 14px;
          }

          b {
            font-size: 35px;
            font-weight: bold;
          }
        }

        s {
          font-size: 10px;
        }
        .vip-large {
          margin-top: 20px;
          p {
            text-align: center;
            margin-bottom: 15px;
          }
        }

        .btn {
          width: 100%;
          margin-top: 15px;
          padding: 8px 0;
          border-radius: 5px;
          border: none;
          cursor: pointer;
        }
      }

      .bottom-wrap {
        padding: 18px 16px 0;

        li {
          display: flex;
          align-items: center;
          justify-content: space-between;
          margin-bottom: 13px;

          span {
            font-size: 14px;
            color: #021429;
          }
        }
      }
    }
  }
}
</style>
